package com.qdxwx.data.mapper.teacher;


import com.qdxwx.common.page.PageRequest;
import com.qdxwx.models.course.CourseQuery;
import com.qdxwx.models.teacher.Teacher;
import com.qdxwx.models.teacher.TeacherQuery;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 教师dao层接口
 * Qdx NetSchool Platform
 * @author qdxwx
 * @updateTime 2022/5/25
 * @description
 */
@Repository
public interface TeacherMapper {

    int insertTeacher(Teacher teacher);

    int updateTeacher(Teacher teacher);

    Teacher selectById(int id);

    Teacher selectByUserId(long userId);

    Teacher selectByMobile(String mobile);

    List<Teacher> selectTeacherList(@Param("e") TeacherQuery query, @Param("page") PageRequest page);

    List<Teacher> selectTeacherListByCourseId(@Param("courseId") int courseId);

    List<Teacher> selectTeacherListByBookId(@Param("bookId") int bookId);

    List<Teacher> selectTeacherListByCourse(@Param("e") CourseQuery courseQuery, @Param("limit") int limit);

    int countTeacher(@Param("e") TeacherQuery query);

    int updateDisabled(int id, int isDisabled);

    int updateViewCount(int id);

    int updateLikeCount(int id);

    int deleteById(@Param("id") int id);

    int updateSort(int id, int sort);

    int updateCombine(long userId1, long userId2);
}